package kr.co.sdsway2.service;

import javax.annotation.Resource;

import kr.co.sdsway2.common.AbstractService;
import kr.co.sdsway2.dao.PollAswInfDAO;
import kr.co.sdsway2.vo.PollAswInfVO;

import org.springframework.stereotype.Service;

@Service
public class PollAswService extends AbstractService{

	@Resource(name="pollAswInfDAO")
	PollAswInfDAO pollAswInfDAO;

	@Resource(name="pollAswInfBeanService")
	PollAswInfBeanService pollAswInfBeanService;


	/** 답변 입력 */
	public int updatePollAsw(Integer ptId, Integer pollId, String avatarId,
			String aswVal) {
		// TODO Auto-generated method stub
		
		//1. 답변 DB에 입력 S ==============================
		PollAswInfVO vo = new PollAswInfVO();
		vo.setPtId(ptId);
		vo.setPollId(pollId);
		vo.setAvatarId(avatarId);
		vo.setAswVal(aswVal);
		//DB인서트는 추후에 ...!
		//pollAswInfDAO.insertPollSubAswInf(vo);
		//1. 답변 DB에 입력 E ==============================
		
		//2. 답변 Bean에 입력 S ==============================
		return pollAswInfBeanService.update(ptId, pollId, avatarId, aswVal);
		//2. 답변 Bean에 입력 E ==============================
	}
}
